<template>
<div>
  <h1>发货</h1>
  <table>
    <tr>
      <td>订单</td>
      <td>发货地</td>
      <td>收货地</td>
      <td>用户手机号</td>
      <td>状态</td>
    </tr>
    <tr v-for="i in huo">
      <td>{{i.name}}</td>
      <td>{{i.sarea}}</td>
      <td>{{i.earea}}</td>
      <td>{{i.user_mobile}}</td>
      <td>
        <button v-if="i.status==1" @click="fahuo(i.id)">未发货</button>
        <button v-else :disabled="true">已发货</button>
      </td>
    </tr>
  </table>
</div>
</template>

<script>
export default {
name: "show_send",
  data(){
  return{
    huo:[]
    }
  },
    methods:{
     get_huo(){
       this.$axios.get('users/huoM').then(res=>{
         this.huo = res.data.list
       })
     },
      fahuo(id){
       this.$axios.post('users/huoM',{'id':id}).then(res=>{
         if(res.data.code==200){
           alert('发货成功')
         }else {
           alert(res.data.mes)
         }
       })
      }
  },mounted() {
  this.get_huo()
  }
}
</script>

<style scoped>

</style>
